package com.example.pet.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.ViewPropertyAnimatorListenerAdapter;
import androidx.fragment.app.Fragment;
import androidx.viewpager2.widget.ViewPager2;

import com.example.pet.R;
import com.example.pet.adapter.HomeViewPageAdapter;

import java.util.ArrayList;
import java.util.List;

public class LoginActivity extends AppCompatActivity {
    private ViewPager2 viewPager2;

    @SuppressLint("MissingInflatedId")
    @Override
    protected void onCreate(Bundle savedInstanceState){

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login_xd);
        viewPager2 = findViewById(R.id.main_vp2);
        List<Fragment> fragmentList = new ArrayList<>();
        fragmentList.add(ContentFragment.newInstance());
        fragmentList.add(Myself_fragment.newInstance());
        HomeViewPageAdapter homeViewPageAdapter = new HomeViewPageAdapter(getSupportFragmentManager(),getLifecycle(),fragmentList);
        viewPager2.setAdapter(homeViewPageAdapter);
    }
}
